package com.yanqu.road.entity.activity.peakstronghold;


import com.yanqu.road.utils.string.StringUtils;

import java.math.BigInteger;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class PeakStrongHoldGuessValueArgs {

	//猜对了几场
	private BigInteger value;

	private int timeId;

	//才对次数=人次;才对次数=人次;才对次数=人次;才对次数=人次;才对次数=人次
	private String param;

	//哪个condition需要触发
	private int conditionId;

	private Map<Integer,Integer> rightCountUserCountMap = new ConcurrentHashMap<>();

	public PeakStrongHoldGuessValueArgs(BigInteger value, String param, int conditionId) {
		this.value = value;
		this.param = param;
		this.conditionId = conditionId;
		List<String> tempStringList = StringUtils.stringToStringList(param,"\\|");
		int timeId = Integer.valueOf(tempStringList.get(0));

		if(tempStringList.size() > 1){
			List<String> tempRightList = StringUtils.stringToStringList(tempStringList.get(1),";");
			//多少场的猜对多少人的
			Map<Integer,Integer> rightCountUserCountMap = new ConcurrentHashMap<>();
			for(String rigStr : tempRightList){
				List<Integer> aaList = StringUtils.stringToIntegerList(rigStr,"=");
				rightCountUserCountMap.put(aaList.get(0),aaList.get(1));
			}
			this.rightCountUserCountMap = rightCountUserCountMap;
		}

		this.timeId = timeId;
	}

	public BigInteger getValue() {
		return value;
	}

	public int getTimeId() {
		return timeId;
	}

	public String getParam() {
		return param;
	}

	public int getConditionId() {
		return conditionId;
	}

	public Map<Integer, Integer> getRightCountUserCountMap() {
		return rightCountUserCountMap;
	}
}
